package com.shycloud.mido.member.service;

import com.alipay.api.response.AlipayUserAgreementQueryResponse;
import com.shycloud.mido.common.core.util.R;
import com.shycloud.mido.member.api.vo.PayHardwareDepositResultVO;
import java.math.BigDecimal;
import java.util.Map;

import java.util.SortedMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.shycloud.mido.common.pay.alipay.bean.AliReturnPayBean;

/**
 * 支付业务 service
 *
 * @author nianhua.jiang
 * @date 2020/8/7 9:41
 */
public interface PayService {

	//TODO ************************************* 支付宝支付 START ****************************************************//

	/** 支付宝支付 快乐贝 */
	Map<String, String> aliPay(Map<String, Integer> map);

	/** 支付宝支付 VIP */
	Map<String, String> aliPayVip(Map<String, Integer> map);

	/** 支付宝支付 教辅权限 */
	Map<String, String> aliPayAssistPermission(Map<String, Object> map);

	/** 支付宝支付 app在线课课时包 */
	Map<String, String> aliPayOnlineCourse(Map<String, Integer> map);

	/** 支付宝支付 后台管理商城 */
	Map<String, String> alipayWebPrePay(String orderNo, BigDecimal payTotal);

	/** 支付宝支付 H5套餐购买 */
	Map<String, String> payComboH5(Map<String, Object> map);

	/** 支付宝支付 H5套餐购买回调（分账业务） */
	void payComboH5Notify(HttpServletRequest request, AliReturnPayBean returnPay, HttpServletResponse response);

	/** 支付宝支付 H5套餐购买 查询订单结果 */
	Map<String, String> getComboH5Result(String orderNo);

	/** 支付宝支付 合作商租赁押金 */
	Map<String, String> aliPayHardwareDeposit(Map<String, Object> map);

	/** 支付宝支付回调 */
	String aliNotify(HttpServletRequest request, AliReturnPayBean returnPay, HttpServletResponse response);

	/** 支付宝自动续费支付回调 */
	void aliAgreementSignNotify(HttpServletRequest request, AliReturnPayBean returnPay, HttpServletResponse response);

	/** 支付宝主动扣款批处理 */
	boolean batchAliTradePay();
	//TODO ************************************* 支付宝支付 E N D ****************************************************//

	//TODO ************************************* 微信支付 START *****************************************************//

	/** 微信支付 快乐贝 */
	Map<String, Map> wxPay(Map<String, Integer> map, HttpServletRequest request);

	/** 微信购买 vip */
	Map<String, Map> wxPayVip(Map<String, Integer> map, HttpServletRequest request);

	/** 微信支付 小程序直播/录播 */
	Map<String, Map> wxMiniPay(Map<String, String> map, HttpServletRequest request);

	/** 微信支付 教辅权限 */
	Map<String, Map> wxPayAssistPermission(Map<String, Object> map, HttpServletRequest request);

	/** 微信支付 在线课课时包 APP内部 */
	Map<String, Map> wxPayOnlineCourse(Integer orgId, Integer goodsId, HttpServletRequest request);

	/** 微信支付 后台管理商城 */
	Map<String, String> wxWebPrePay(HttpServletRequest request, String orderNo, BigDecimal payTotal);

	/** 微信支付 硬件押金 */
	Map<String, String> wxPayHardwareDeposit(Map<String, Object> map, HttpServletRequest request);

	/** 微信支付回调 */
	void wxNotify(HttpServletRequest request, HttpServletResponse response);
	//TODO ************************************* 微信支付 E N D *****************************************************//

	//TODO ************************************* IOS 支付 START ****************************************************//

	/** IOS 快乐贝购买 */
	Boolean getIosPayResult(String orderId, String iosCode, String transactionId, String payload);

	/** IOS 会员购买 */
	Boolean payVipForIos(String orderId, String productId, String transactionId, String payload, String originalTransactionId);

	/** IOS 教辅权限购买 */
	Boolean payAssistForIos(String orderId, String productId, String transactionId, String payload,
			String teacherId, String studentId) throws Exception;

	/** IOS app在线课课时包购买 */
	Boolean payOnlineCourseForIos(String orderId, String productId, String transactionId, String payload, Integer orgId);
	//TODO ************************************* IOS 支付 END ****************************************************//

	/** 购买单本曲集 */
	Boolean payCollection(Integer collectionId);

	PayHardwareDepositResultVO getPayHardwareDepositResult(String orderNo);

	void iosNotify(String signedPayload);

	Boolean addIosOrderLog(String orderId, String productId, String transactionId, String payload, String memberId);

}
